# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgname=kaffeine
pkgver=2.0.18
pkgrel=4
pkgdesc='KDE media player'
license=(GPL)
arch=(loong64 x86_64)
url='https://kde.org/applications/multimedia/org.kde.kaffeine'
depends=(gcc-libs
         glibc
         kconfig5
         kconfigwidgets5
         kcoreaddons5
         kdbusaddons5
         ki18n5
         kio5
         kwidgetsaddons5
         kwindowsystem5
         kxmlgui5
         libxss
         qt5-base
         qt5-x11extras
         solid5
         v4l-utils
         vlc)
makedepends=(extra-cmake-modules
             kdoctools5
             kidletime5)
source=(https://download.kde.org/stable/$pkgname/$pkgname-$pkgver.tar.xz{,.sig}
        https://invent.kde.org/multimedia/kaffeine/-/commit/209a263a.patch)
sha256sums=('d9799a5b7b94a55963f94938b36b8fcb1be3e753b2be110989934ab15386b681'
            'SKIP'
            'd3576160e7a0592c26b20531df2c2a1bb59f12c468b6949cb2c9243961630f0c')
validpgpkeys=(F909AE68FC11DF09C1755C00085F3EBD8EE4E115) # Mauro Carvalho Chehab <mchehab@s-opensource.com>

prepare() {
  patch -d $pkgname-$pkgver -p1 < 209a263a.patch # Fix DVB-T scan data update
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
